package com.zx.nacosconsumer.service;

import com.zx.nacosconsumer.fallback.ProviderFallback;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;

/**
 * @Description FeignClient
 * 通过注解表明服务和接口
 * @Author Zhang Xin
 * @Date 2020/7/23
 */
//@FeignClient("nacos-provider")
// 在feign接口FeignClientService中指定熔断类：
@FeignClient(value = "nacos-provider", fallback = ProviderFallback.class)
public interface FeignClientService {
    @GetMapping("/hi")
    String hi(@RequestParam(value = "name", defaultValue = "ZX", required = false) String name);
}
